<label for="cheatsheet_title">Title</label>
<%= form.text_field :title %>

<label for="cheatsheet_link">Permalink</label>
<%= form.text_field :permalink %>

<label for="article_content">Description</label>
<%= form.text_area :description%>

<label for="article_content"> Content</label>
<%= form.text_area :content %>

 <%= observe_field :cheatsheet_content, :url => preview_cheatsheets_path,
      :update => :article, :frequency => 2,
      :with => "content"    %>
	  
<div id="article" style="height:350px; overflow:auto;width:100%;"></div>

<label for="article_date"><%= diamond %> Date</label>
<%= form.datetime_select :date %>

<p><label for="article_version_number">Version</label>
<%= form.collection_select(:version_id, Version.find(:all, :order => :version_number), :id, :version_number) %> <i>or add new version</i>
<%= form.text_field :new_version %></p>

<p><label for="categories">Categories</label>
	<%= form.collection_select("category_ids", Category.find(:all, :order => :name), :id, :name, {}, :multiple=> :true, :name=>'cheatsheet[category_ids][]') %></p>

<p><label for="related_articles"> Related articles</label>
	<%= form.collection_select("related_article_ids", Content.find(:all, :order => :title), :id, :title, {}, :multiple=> :true, :name=>'cheatsheet[related_article_ids][]') %></p>

	
<% fields_for "cheatsheet[binary_attributes][pdf]" do |pdf_fields| %>
    <p><label for="pdf"><%= diamond %> PDF</label>
	<%= pdf_fields.file_field :uploaded_data %></p>
<% end %>
    
<% fields_for "cheatsheet[binary_attributes][thumbnail]" do |thumbnail_fields| %>
	<p><label for="thumbnail"><%= diamond %> Thumbnail</label>
	<%= thumbnail_fields.file_field :uploaded_data %></p>
<% end %>
